package cs8;

public class Address {
	public String addressName;
	public String zipCode;
	
	public Address(){
	}
	public Address(String addressName,String zipCode){
		this.addressName=addressName;
		this.zipCode=zipCode;
	}
	public String getAddressName() {
		return addressName;
	}
	public void setAddressName(String addressName) {
		this.addressName = addressName;
	}
	public String getZipCode() {
		return zipCode;
	}
	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}
	@Override
	public String toString() {
		return "Address [addressName=" + addressName + ", zipCode=" + zipCode + "]";
	}
	@Override
	public boolean equals(Object obj){
		Address add = null;
		if(obj instanceof Address){
			add = (Address)obj;
		}
		if(add.getAddressName().equals(this.addressName)&&add.getZipCode().equals(this.zipCode)){
			return true;
		}
		return false;
	}
	@Override
	public int hashCode(){
		int hashCode = this.zipCode.hashCode()+this.addressName.hashCode();
		return hashCode;
	}

	
}
